
#import "WishTableViewCell.h"

@implementation WishTableViewCell

- (void)setModel:(WishesModel *)model {
    
    _model = model;
    self.niceName.text = model.title;
    self.price.text = [NSString stringWithFormat:@"¥%ld",(long)model.wishRewardPrice];
    self.num.text = [NSString stringWithFormat:@"%ld",(long)model.wishRewardNum];
    self.pleaseSupport.text = [NSString stringWithFormat:@"%.0lf",model.price];
    NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
    [formatter setDateStyle:NSDateFormatterMediumStyle];
    [formatter setTimeStyle:NSDateFormatterShortStyle];
    [formatter setDateFormat:@"yyyy-MM-dd"];
    NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"];
    [formatter setTimeZone:timeZone];
    NSDate *confromTimesp = [NSDate dateWithTimeIntervalSince1970:[model.wishAddTime integerValue]];
    NSString *timeString = [formatter stringFromDate:confromTimesp];
    self.time.text = timeString;
    
    if (model.price == 0 && model.price != 0) {
        self.wishPogress.progress = 1;
    }else {
        self.wishPogress.progress = model.wishRewardPrice / model.price;
        self.Proportion.text = [NSString stringWithFormat:@"%.0lf%%",model.wishRewardPrice / model.price*100];
    }
    self.hot.text = [NSString stringWithFormat:@"%ld",(long)model.wishRewardNum];
    
    
    
}



@end
